package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author fanp
 * @version v1.0.0
 * @Description :
 * @Create on : 2021/2/8 15:03
 **/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_coupons")
public class CouponsDo extends Model<CouponsDo> {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private long id;

    @TableField("open_id")
    private String openId;

    @TableField("user_id")
    private long userId;

    @TableField("code")
    private String code;

    @TableField("worth")
    private long worth;

    @TableField("limit_time")
    private long limitTime;

    @TableField("limit_condition")
    private long limitCondition;

    @TableField("type")
    private int type;

    @TableField("describes")
    private String describes;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "delete_time",fill = FieldFill.DEFAULT)
    private Date deleteTime;

    @TableField("delete_by")
    private long deleteBy;

    @TableField("delete_flag")
    private int deleteFlag;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
